﻿using System;

namespace IDesktop.Core {

    public class WeatherInfo {
        private string _dayWeather;
        private string _nightWeather;

        /// <summary>
        /// 城市代码
        /// </summary>
        public string ID {
            get;
            set;
        }

        /// <summary>
        /// 城市名称
        /// </summary>
        public string Name {
            get;
            set;
        }

        /// <summary>
        /// 白天天气
        /// </summary>
        public string DayWeather {
            get {
                return _dayWeather;
            }
            set {
                if (value != null) {
                    _dayWeather = value.Contains("转") ? value.Split(new string[] { "转" }, StringSplitOptions.RemoveEmptyEntries)[0] : value;
                    _nightWeather = value.Contains("转") ? value.Split(new string[] { "转" }, StringSplitOptions.RemoveEmptyEntries)[1] : value;
                }
            }
        }

        /// <summary>
        /// 夜间天气
        /// </summary>
        public string NightWeather {
            get {
                return _nightWeather;
            }
        }

        /// <summary>
        /// 白天气温
        /// </summary>
        public string DayTemperature {
            get;
            set;
        }

        /// <summary>
        /// 夜间气温
        /// </summary>
        public string NightTemperature {
            get;
            set;
        }

        /// <summary>
        /// 更新时间
        /// </summary>
        public string UpdateTime {
            get;
            set;
        }
    }
}
